import { AxesHelper,PointLightHelper } from 'three'
import {pointLight} from './TLights'
import {camera} from './ThreeEngine'
import { GUI } from 'three/examples/jsm/libs/lil-gui.module.min.js'
export const allHelper = []

export const pointLightHelper = new PointLightHelper( pointLight, 1 );

// 坐标辅助
export const axesHelper = new AxesHelper(500)  // 创建坐标辅助 （500 为辅助线的长度）

//创建GUI
const gui = new GUI()
let folder = gui.addFolder('相机')
folder
  .add(camera, 'zoom')
  .min(-20)
  .max(20)
  .name('缩放')
  .onChange((val) => {
    camera.updateProjectionMatrix()
  })
folder
  .add(camera.position, 'x')
  .min(-120)
  .max(120)
  .name('x')
  .onChange((val) => {
    camera.updateProjectionMatrix()
  })
folder
  .add(camera.position, 'y')
  .min(-120)
  .max(120)
  .name('y')
  .onChange((val) => {
    camera.updateProjectionMatrix()
  })
folder
  .add(camera.position, 'z')
  .min(-120)
  .max(120)
  .name('z')
  .onChange((val) => {
    camera.updateProjectionMatrix()
  })

allHelper.push(axesHelper,pointLightHelper)  // 添加到辅助列表
